package PrototypePattern;

/**
 * @Author: zhaojie
 * @Date: Created in 13:36 2018/6/26
 * @Description: PrototypePatternDemo 使用 ShapeCache 类来获取存储在 Hashtable 中的形状的克隆。
 * 原形模式
 */
public class PrototypePatternDemo {

    public static void main(String[] args) {
        ShapeCache.loadCache();

        Shape clonedShape =  ShapeCache.getShape("1");
        System.out.println("Shape : " + clonedShape.getType());

        Shape clonedShape2 =   ShapeCache.getShape("2");
        System.out.println("Shape : " + clonedShape2.getType());

        Shape clonedShape3 =   ShapeCache.getShape("3");
        System.out.println("Shape : " + clonedShape3.getType());
    }

}
